Skip to content

Versioned documentation: keep the public default on the latest stable release - #246

Merged
alxmrs merged 22 commits into
xqlsystems:mainfrom
Mmoncadaisla:docs/versioned-docs
Aug 19, 2026
Merged

Versioned documentation: keep the public default on the latest stable release#246
alxmrs merged 22 commits into
xqlsystems:mainfrom
Mmoncadaisla:docs/versioned-docs

Conversation

@Mmoncadaisla

Copy link
Copy Markdown
Collaborator

Why

Publishing the v0.4.0-rc.1 pre-release replaced the public docs site with unreleased content: the site deploys from main as a single version, and main now is the RC. Pre-release docs should be available, but the public default should stay on the latest stable release.

What

Docs are now versioned with the Zensical fork of mike. Each version lives in its own directory on a gh-pages branch, with a version selector on every page. Pages still publishes through the existing artifact flow, so the Pages source setting stays as it is.

Event Deploys to latest (public default)
Push to main dev/ unchanged
Pre-release published rolling rc/, titled with the tag unchanged
Stable release published X.Y/ moves here
Manual run any version, built from any tag only if requested

Safeguards worth knowing about:

  • latest never moves backward (a v0.3.4 after v0.4.0 won't repoint the site) and can never point at rc.
  • A -rc.N suffix in the tag routes to rc/ even if the pre-release checkbox was forgotten.
  • Rolling versions (dev, rc) are newest-wins under concurrent builds; stable releases deploy in publish order.
  • Release tags are validated before use, and the mike fork is pinned to a commit (it installs from a mutable branch in a job with contents: write).

After merging (one-time)

  1. Allow tag deploys: Settings → Environments → github-pages → deployment branches and tags → add tag rule v*. Today only main may deploy, which would reject release-triggered runs.
  2. Backfill the stable docs: Actions → "Build documentation" → Run workflow on main with ref v0.3.3, version 0.3, "latest" ticked.

Until step 2 runs, the old site stays live — the workflow refuses to publish a site that has no default version yet.

Notes

  • Docs deploy independently of the PyPI publish. If a release goes bad, CONTRIBUTING now documents how to move latest back and delete a version.
  • Verified locally end to end: version deploys, alias moves, root redirect, rc titling, idempotent re-runs, zensical build, and the unit suite.

…rsioning site stays live through the migration.
…d workflow-level group can drop a pending release run, losing its latest-alias move.
…ust not overwrite the stable X.Y that 'latest' points to.
… tag uses that tag's workflow definition, which has no manual trigger.
…rough the workflow, since gh-pages pushes alone never reach Pages.
…very push attempt; the resolve-time check could act on stale state when releases overlap.
…er build cannot overwrite dev/ or rc/ content.
…e checkbox, and inject the version provider when backfilling docs from pre-versioning tags.
… confirmed-absent gh-pages branch may bypass the guard.
…hyphen in the tag; build metadata may contain hyphens.
… stale local branch replays the same non-fast-forward rejection.

@alxmrs alxmrs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for finding the right set of documentation generating technologies.

@alxmrs
alxmrs merged commit e8ee4d2 into xqlsystems:main Aug 19, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants